<template>
	<page-meta :root-font-size="getRootFontSize()"></page-meta>
	<view class="">
		<view class="topBox">
			<view class="status_bar"></view>
			<uni-nav-bar
				style="width: 750rpx; height: 44px; border-bottom: 1px solid #F2F2F2;"
				@clickRight="showSetUp"
				@clickLeft="goHome"
				color="#FDFDFD"
				:border="false"
				:shadow="false"
				background-color="#CD001B"
			>
				<view class="titleImg"><image style="width: 100%; height: 100%;" mode="scaleToFill" src="/static/icon/logo_ctw@3x.png"></image></view>
				<view slot="left">
					<view class="leftIconBox"><uni-icons type="arrowleft" color="#000" size="18"></uni-icons></view>
				</view>
				<view slot="right"><uni-icons type="bars" color="#FDFDFD" size="28"></uni-icons></view>
			</uni-nav-bar>
		</view>

		<view class="zhuti" :style="{ marginTop: topBar }">
			<!-- 标题 -->
			<view class="titleBox">
				<view class="titleBoxcenter">
					<text>{{ i18n.ctwfont1 }}</text>
				</view>
			</view>
			<!-- 导出 -->
			<view class="daochuBox">
				<view class="daochuBoxL">
					<text>{{ i18n.ctwfont3 }}:</text>
					<text style="color: #038A15; margin-left: 5px;">{{ type(cardArrList.orderStatusType) }}</text>
				</view>
				<view class="daochuBoxR">
					<!-- 			<button size="mini" @tap="getImg(cardArrList.goodsListImage)" :class="cardArrList.goodsListImage !== '' ? 'chaBtn' : 'chaBtn2'" type="default">
						<uni-icons type="image" size="14" color="#fff" style="margin-right: 5px;"></uni-icons>
						{{ i18n.ctwfont48 }}
					</button> -->
					<!-- 				<button size="mini" class="searchBtn2" type="default">
						<uni-icons type="upload-filled" size="14" style="margin-right: 5px;"></uni-icons>
						导出
					</button> -->
				</view>
			</view>
			<view class="detailsBoxTop">
				<view class="detailsBoxTopTitle">
					<view class="detailsBoxTopTitleL">{{ i18n.ctwfont4 }}</view>
					<view class="detailsBoxTopTitleR">{{ cardArrList.billCode }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxTopTitle">
					<view class="detailsBoxTopTitleL">{{ i18n.ctwfont61 }}</view>
					<view class="detailsBoxTopTitleR">{{ cardArrList.createCustomerCodeAndPhone }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxTopTitle">
					<view class="detailsBoxTopTitleL">{{ i18n.ctwfont5 }}</view>
					<view class="detailsBoxTopTitleR">{{ cardArrList.oldBillCode }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxTopTitle">
					<view class="detailsBoxTopTitleL">{{ i18n.ctwfont6 }}</view>
					<view class="detailsBoxTopTitleR">{{ cardArrList.customerCode }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxTopTitle">
					<view class="detailsBoxTopTitleL">{{ i18n.ctwfont7 }}</view>
					<view class="detailsBoxTopTitleR">{{ cardArrList.thirdCustomerCode }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxTopTitle">
					<view class="detailsBoxTopTitleL">{{ i18n.ctwfont8 }}</view>
					<view class="detailsBoxTopTitleR">{{ cardArrList.orderTime }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxTopTitle">
					<view class="detailsBoxTopTitleL">{{ i18n.ctwfont9 }}</view>
					<view class="detailsBoxTopTitleR">{{ deliveryTimeFn(cardArrList.deliveryTime) }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxTopTitle">
					<view class="detailsBoxTopTitleL">{{ i18n.ctwfont10 }}</view>
					<view class="detailsBoxTopTitleR">{{ transport(cardArrList.transportModeName) }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxTopTitle">
					<view class="detailsBoxTopTitleL">{{ i18n.ctwfont18 }}</view>
					<view class="detailsBoxTopTitleR">{{ cardArrList.currencyTypeName }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxTopTitle">
					<view class="detailsBoxTopTitleL">{{ i18n.ctwfont11 }}</view>
					<view class="detailsBoxTopTitleR">{{ paymentMethod(cardArrList.paymentTypeName) }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxTopTitle">
					<view class="detailsBoxTopTitleL">{{ i18n.ctwfont12 }}</view>
					<view class="detailsBoxTopTitleR">{{ Number(cardArrList.paymentTerm) === 0 ? '' : cardArrList.paymentTerm }}</view>
				</view>
			</view>
			<view class="detailsBoxZho">
				<view class="detailsBoxZhoTitle">
					<view class="detailsBoxZhoTitleL">{{ i18n.ctwfont2 }}</view>
					<view class="detailsBoxZhoTitleR"><uni-icons type="bottom" color="#000" size="20"></uni-icons></view>
				</view>
				<view class="detailsBoxZhoText" style="margin-top: 5px;">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont14 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.trackingNumber }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont15 }}</view>
					<view class="detailsBoxZhoTextR">{{ delivery(cardArrList.deliveryAddressName) }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont21 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.fitOutNo }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont22 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.operation }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont27 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.remark }}</view>
				</view>
				<!-- <view class="lineBox"></view> -->
				<!-- 			<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont25 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.controlTypeName }}</view>
				</view> -->
			</view>
			<view class="detailsBoxZho">
				<view class="detailsBoxZhoText" style="margin-top: 5px;">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont16 }}</view>
					<view class="detailsBoxZhoTextR">{{ totalCost(cardArrList) }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont19 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.customerDeposit }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont23 }}</view>
					<view class="detailsBoxZhoTextR">{{ Balance(cardArrList) }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont20 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.serviceCharge }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont17 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.domesticTransportationFee }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont24 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.insurance }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont26 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.packageFee }}</view>
				</view>
			</view>
			<view class="detailsBoxZho" style="padding-bottom: 1px;">
				<view class="detailsBoxZhoTitle">
					<view class="detailsBoxZhoTitleL">{{ i18n.ctwfont28 }}</view>
					<view class="detailsBoxZhoTitleR"><uni-icons type="bottom" color="#000" size="20"></uni-icons></view>
				</view>
				<uni-collapse accordion>
					<!-- 					v-show="item.advanceReceiveQuantity"
					v-if="item.orderItemNo === '' || item.orderItemNo === null ? false : true" -->
					<uni-collapse-item :title="item.orderItemNo || i18n.ctwfont29 + '-' +(index + 1)" v-for="(item, index) in cardArrList.infoDetails" :key="index">
						<view class="lineBox"></view>
						<view class="detailsBoxZhoText">
							<view class="detailsBoxZhoTextL">{{ i18n.ctwfont29 }}</view>
							<view class="detailsBoxZhoTextR">{{ item.orderItemNo }}</view>
						</view>
						<view class="lineBox"></view>
						<view class="detailsBoxZhoText">
							<view class="detailsBoxZhoTextL">{{ i18n.ctwfont30 }}</view>
							<view class="detailsBoxZhoTextR">{{ item.cargoDetails }}</view>
						</view>
						<view class="lineBox"></view>
						<view class="detailsBoxZhoText">
							<view class="detailsBoxZhoTextL">{{ i18n.ctwfont31 }}</view>
							<view class="detailsBoxZhoTextR">{{ item.advanceReceiveQuantity }}</view>
						</view>
						<view class="lineBox"></view>
						<view class="detailsBoxZhoText">
							<view class="detailsBoxZhoTextL">{{ i18n.ctwfont32 }}</view>
							<view class="detailsBoxZhoTextR">{{ item.unitPrice }}</view>
						</view>
						<view class="lineBox"></view>
						<view class="detailsBoxZhoText" style="padding-bottom: 5px;">
							<view class="detailsBoxZhoTextL">{{ i18n.ctwfont33 }}</view>
							<view class="detailsBoxZhoTextR">{{ item.advanceReceiveAmount }}</view>
						</view>
					</uni-collapse-item>
				</uni-collapse>
			</view>
			<view class="detailsBoxZho" style="padding-bottom: 1px;">
				<view class="detailsBoxZhoTitle">
					<view class="detailsBoxZhoTitleL">{{ i18n.ctwfont34 }}</view>
					<view class="detailsBoxZhoTitleR"><uni-icons type="bottom" color="#000" size="20"></uni-icons></view>
				</view>
				<uni-collapse accordion v-show="Number(cardArrList.actualReceiptAudit) === 1">
					<!-- v-show="item.actualQuantity" -->
					<!-- v-if="item.orderItemNo === '' || item.orderItemNo === null ? false : true" -->
					<uni-collapse-item :title="item.orderItemNo || i18n.ctwfont29 + '-' +(index + 1)" v-for="(item, index) in cardArrList.infoDetails" :key="index">
						<view class="lineBox"></view>
						<view class="detailsBoxZhoText">
							<view class="detailsBoxZhoTextL">{{ i18n.ctwfont29 }}</view>
							<view class="detailsBoxZhoTextR">{{ item.orderItemNo }}</view>
						</view>
						<view class="lineBox"></view>
						<view class="detailsBoxZhoText">
							<view class="detailsBoxZhoTextL">{{ i18n.ctwfont30 }}</view>
							<view class="detailsBoxZhoTextR">{{ item.cargoDetails }}</view>
						</view>
						<view class="lineBox"></view>
						<view class="detailsBoxZhoText">
							<view class="detailsBoxZhoTextL">{{ i18n.ctwfont41 }}</view>
							<view class="detailsBoxZhoTextR">{{ item.actualQuantity }}</view>
						</view>
						<view class="lineBox"></view>
						<view class="detailsBoxZhoText">
							<view class="detailsBoxZhoTextL">{{ i18n.ctwfont32 }}</view>
							<view class="detailsBoxZhoTextR">{{ item.unitPrice }}</view>
						</view>
						<view class="lineBox"></view>
						<view class="detailsBoxZhoText" style="padding-bottom: 5px;">
							<view class="detailsBoxZhoTextL">{{ i18n.ctwfont42 }}</view>
							<view class="detailsBoxZhoTextR">{{ item.actualAmount }}</view>
						</view>
					</uni-collapse-item>
				</uni-collapse>
			</view>
			<view class="detailsBoxZho">
				<view class="detailsBoxZhoTitle">
					<view class="detailsBoxZhoTitleL">{{ i18n.ctwfont35 }}</view>
					<view class="detailsBoxZhoTitleR"><uni-icons type="bottom" color="#000" size="20"></uni-icons></view>
				</view>
				<view class="detailsBoxZhoText" style="margin-top: 5px;">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont36 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.deliverModeName === '供应商送货' ? i18n.ctwfont39 : '' }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont37 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.actualReceiptAuditTime }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont38 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.storeHouseNumber }}</view>
				</view>
				<!-- 			<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont39 }}</view>
					<view class="detailsBoxZhoTextR">{{cardArrList.supplier}}</view>
				</view> -->
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont43 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.supplier }}</view>
				</view>
				<view class="lineBox"></view>
				<view class="detailsBoxZhoText">
					<view class="detailsBoxZhoTextL">{{ i18n.ctwfont40 }}</view>
					<view class="detailsBoxZhoTextR">{{ cardArrList.supplierPhone }}</view>
				</view>
			</view>
			<view style="height: 30px;"></view>
		</view>
		<!-- 设置 -->
		<uni-popup ref="SetUpPopup" type="center" :animation="false"><set-up-pages ref="showPopup" @closePopUp="closePopUp" /></uni-popup>
		<!-- 退出 -->
		<sign-out ref="signOutBox" />
	</view>
</template>

<script>
import setUpPages from '@/pages/setUpPages/index.vue';
import signOut from '@/pages/setUpPages/signOut.vue'; // 退出登录
import { getStorage } from '@/utils/setStorage.js';
import baseFont from '@/utils/baseFont.js';
export default {
	extends: baseFont,
	data: function() {
		return {
			topBarHeight: 0, // 导航栏高度
			back_k: 0,
			popupIsShow: false, // 打开设置的标识
			signOutShow: false, // 退出登录
			num: 0,
			date: '',
			url: '/pages/maps/index',
			customerCode: '',
			cardArrList: {
				totalAmount: '',
				remittanceDeposit: '',
				arrivalDate: '',
				insurance: '',
				oldBillCode: '',
				billCode: '',
				trackingNumber: '',
				customerCode: '',
				transportMode: '',
				transportModeName: '',
				orderTime: '',
				currencyType: '',
				currencyTypeName: '',
				deliverMode: '',
				deliverModeName: '',
				deliveryAddress: '',
				deliveryAddressName: '',
				storeHouseNumber: '',
				preAcceptanceReviewTime: '',
				actualReceiptAuditTime: '',
				supplier: '',
				supplierPhone: '',
				orderStatusType: '',
				advanceReceiptFee: '',
				paymentType: '',
				paymentTypeName: '',
				preAcceptanceReview: '',
				actualReceiptAudit: '',
				packageFee: '',
				domesticTransportationFee: '',
				remark: '',
				customerDeposit: '',
				operation: '',
				serviceCharge: '',
				controlType: '',
				controlTypeName: '',
				actualDeliveryTime: '',
				deliveryTime: '',
				paymentTerm: '',
				fileName: '',
				payType: '',
				payState: '',
				remainingAmount: '',
				payStatus: '',
				docRemark: '',
				infoDetails: [
					{
						orderItemNo: '',
						cargoDetails: '',
						advanceReceiveQuantity: '',
						advanceReceiveAmount: '',
						actualQuantity: '',
						actualAmount: '',
						unitPrice: ''
					}
				],
				thirdCustomerCode: '',
				carton: '',
				fiberBag: '',
				woodenBox: '',
				goodsListImage: '',
				auditFlag: '',
				infoStoreDetails: [],
				fitOutNos: '',
				orderCancelTime: '',
				createCustomerCodeAndPhone: ''
			}
		};
	},

	onLoad(option) {
		const { num, date, url, customerCode } = option;
		this.num = num;
		this.date = date.split(',');
		this.url = url || '/pages/maps/index';
		this.customerCode = customerCode;
		// 拦截物理返回键
		this.goBackBox();
	},
	onUnload() {
		uni.$off('goBack_k', this.goBackBox2);
	},
	created() {
		const that = this;
		uni.getSystemInfo({
			success(res) {
				that.topBarHeight = res.statusBarHeight;
			}
		});
		this.getList();
	},
	onHide() {
		this.$refs.SetUpPopup.close();
		this.popupIsShow = false;
		this.$refs.signOutBox.close();
	},
	components: { setUpPages, signOut },
	computed: {
		topBar() {
			let num = 0;
			num = this.topBarHeight + 64; // 44是顶部高度
			return num + 'px';
		},
		i18n() {
			return this.$t('orderDetails');
		},
		totalCost() {
			return function(item) {
				let ter = '';
				if (Number(item.switchPaidData) === 1) {
					ter = item.paidAmount === 0 || item.paidAmount === null ? '' : item.paidAmount;
				} else {
					ter = item.tmpAmount === 0 || item.tmpAmount === null ? '' : item.tmpAmount;
				}
				return ter;
			};
		},
		Balance() {
			return function(item) {
				let ter = '';
				if (Number(item.switchPaidData) === 1) {
					ter = item.paidBalance === 0 || item.paidBalance === null ? '' : item.paidBalance;
				} else {
					ter = item.remainingAmount === 0 || item.remainingAmount === null ? '' : item.remainingAmount;
				}
				return ter;
			};
		},
		type() {
			return function(val) {
				if (val) {
					let text = '';
					if (Number(val) === 1) {
						text = this.$t('maps').ctwfont27;
					} else if (Number(val) === 2) {
						text = this.$t('maps').ctwfont9;
					} else if (Number(val) === 3) {
						text = this.$t('maps').ctwfont10;
					} else if (Number(val) === 4) {
						text = this.$t('maps').ctwfont29;
					} else if (Number(val) === 5) {
						text = this.$t('maps').ctwfont13;
					} else {
						text = this.$t('maps').ctwfont31;
					}
					return text;
				} else {
					return '';
				}
			};
		},
		// 支付方式
		paymentMethod() {
			return function(val) {
				if (val === '急转') {
					return this.$t('orderDetails').ctwfont51;
				} else if (val === '转账') {
					return this.$t('orderDetails').ctwfont52;
				} else if (val === '先付款再送货') {
					return this.$t('orderDetails').ctwfont53;
				} else {
					return val;
				}
			};
		},
		// 运输方式
		transport() {
			return function(val) {
				if (val === '海运') {
					return this.$t('maps').ctwfont39;
				} else if (val === '空运') {
					return this.$t('maps').ctwfont40;
				} else if (val === 'EK') {
					return this.$t('maps').ctwfont41;
				} else {
					return val;
				}
			};
		},
		// 交货地点
		delivery() {
			return function(val) {
				if (val === '广州仓库') {
					return this.$t('orderDetails').ctwfont56;
				} else if (val === '义乌仓库') {
					return this.$t('orderDetails').ctwfont57;
				} else if (val === '东莞仓库') {
					return this.$t('orderDetails').ctwfont58;
				} else if (val === '佛山仓库') {
					return this.$t('orderDetails').ctwfont59;
				} else {
					return val;
				}
			};
		},
		// 处理送货时间
		deliveryTimeFn() {
			return function(val) {
				if (val) {
					return val.substring(0, 10);
				}
			};
		}
	},
	methods: {
		// 返回home
		goHome() {
			if (this.url === '/pages/maps/index') {
				// #ifdef APP-PLUS
				uni.redirectTo({
					url: this.url
				});
				// #endif
				// #ifdef H5
				this.$Router.push(this.url);
				// #endif
			} else {
				// #ifdef APP-PLUS
				uni.redirectTo({
					url: this.url
				});
				// #endif
				// #ifdef H5
				this.$Router.push(this.url);
				// #endif
			}
		},
		goBackBox() {
			// const that = this;
			uni.$on('goBack_k', this.goBackBox2);
		},
		goBackBox2(data) {
			this.back_k < 0 ? (this.back_k = 0) : (this.back_k = this.back_k);
			if (data) {
				let main = plus.android.runtimeMainActivity();
				if (this.back_k > 0) {
					this.back_k = 0;
					return main.moveTaskToBack(false);
					// return plus.runtime.quit();
				} else {
					const pages = getCurrentPages();
					if (pages.length === 1) {
						this.back_k++;
						setTimeout(() => {
							this.back_k--;
						}, 1000);
						if (this.url === '/pages/maps/index') {
							// #ifdef APP-PLUS
							uni.redirectTo({
								url: this.url
							});
							// #endif
							// #ifdef H5
							this.$Router.push(this.url);
							// #endif
						} else {
							// #ifdef APP-PLUS
							uni.redirectTo({
								url: this.url
							});
							// #endif
							// #ifdef H5
							this.$Router.push(this.url);
							// #endif
						}
						// uni.showToast({
						// 	title: '再按一次退出应用',
						// 	icon: 'none',
						// 	duration: 1000
						// });
					}
				}
			}
		},

		// 打开设置
		showSetUp() {
			this.$refs.SetUpPopup.open('right');
			this.popupIsShow = true;
		},
		// 关闭设置
		closePopUp(val) {
			if (val) {
				this.$refs.SetUpPopup.close();
				this.popupIsShow = false;
			} else {
				this.$refs.SetUpPopup.close();
				this.popupIsShow = false;
				this.$refs.signOutBox.open();
				this.signOutShow = true;
			}
		},
		// 获取数据
		async getList() {
			const user = JSON.parse(getStorage('userconter'));
			const params = {
				orderType: 0,
				createCustomerCode: user.customerCode,
				customerCode: this.customerCode ? this.customerCode : user.customerCode,
				page: 1,
				limit: 1,
				orderNumber: this.num,
				beginDate: this.formatDate(this.date[0]),
				endDate: this.formatDate(this.date[1])
			};
			const { data: res } = await this.$http(true, 'api/E3/orderList', params, 'GET');
			if (res.errno === 0) {
				if (res.data.list[0].infoDetails.length <= 0) {
					res.data.list[0].infoDetails = [
						{
							orderItemNo: '',
							cargoDetails: '',
							advanceReceiveQuantity: '',
							advanceReceiveAmount: '',
							actualQuantity: '',
							actualAmount: '',
							unitPrice: ''
						}
					];
				}
				this.cardArrList = res.data.list[0];
			} else {
				uni.showToast({
					title: res.errmsg,
					icon: 'none',
					position: 'top'
				});
			}
		},
		formatDate(value) {
			const dt = new Date(value);
			const y = dt.getFullYear();
			const m = (dt.getMonth() + 1 + '').padStart(2, 0);
			const d = (dt.getDate() + '').padStart(2, 0);
			return `${y}-${m}-${d}`;
		},
		// 预览图片
		getImg(img) {
			if (img) {
				// plus.nativeUI.previewImage([img]);
				// 预览图片
				uni.previewImage({
					urls: [img]
					// longPressActions: {
					// 	itemList: ['发送给朋友', '保存图片', '收藏'],
					// 	success: function(data) {
					// 		console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
					// 	},
					// 	fail: function(err) {
					// 		console.log(err.errMsg);
					// 	}
					// }
				});
			}
		}
	}
};
</script>

<style lang="scss" scoped>
::v-deep .uni-easyinput__content {
	min-height: 30px;
	border: 1px solid #808080;
	border-bottom-right-radius: 0;
	border-top-right-radius: 0;
}
::v-deep .uni-collapse-cell--open {
	background-color: #fbfbfb;
}
::v-deep .uni-collapse-cell--hide {
	height: 30px;
}
::v-deep .uni-collapse-cell {
	background-color: #fbfbfb;
	border: none;
}
::v-deep .uni-collapse-cell__title:active {
	background-color: #fbfbfb;
}
::v-deep .uni-collapse-cell__title {
	padding: 0 10px;
	height: 30px;
	line-height: 30px;
	justify-content: flex-start;
}
::v-deep .uni-collapse-cell__title-text {
	font-size: $uni-font-size-custom-e;
	// font-weight: 600;
	color: #474956;
	flex: none;
}
::v-deep .uni-collapse-cell__title-arrow {
	margin-left: 5px;
	height: 30px;
}
.titleImg {
	width: 60px;
	height: 30px;
	margin: 0 auto;
	border-radius: 50%;
	overflow: hidden;
}
.leftIconBox {
	width: 25px;
	height: 25px;
	background-color: #fff;
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	margin-left: 15px;
}
.topBox {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 10;
	// 顶部部分
	.status_bar {
		height: var(--status-bar-height);
		background-color: #CD001B;
		width: 100%;
	}
}
.zhuti {
	padding: 0 15px;
	box-sizing: border-box;
	.lineBox {
		border-top: 1px solid #cbcbcb;
		margin: 5px 0;
	}
	.titleBox {
		margin-bottom: 5px;
		display: flex;
		justify-content: center;
		.titleBoxcenter {
			width: 100%;
			height: 30px;
			line-height: 30px;
			border-radius: 5px;
			text-align: center;
			background-color: #f2f2f2;
		}
	}
	.daochuBox {
		padding: 15px 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
		.daochuBoxL {
			font-size: $uni-font-size-custom-e;
			color: #424451;
			font-weight: 700;
		}
		.daochuBoxR {
			display: flex;
			align-items: center;
			.searchBtn2 {
				background-color: #ffffff;
				padding: 0 15px;
				margin-right: 0px;
				line-height: 1.8;
			}
			.chaBtn {
				background-color: #CD001B;
				padding: 0 10px;
				border-radius: 5px;
				color: #ffffff;
				line-height: 1.8;
				margin-top: 3px;
			}
			.chaBtn2 {
				background-color: #c1c1c1;
				padding: 0 10px;
				border-radius: 5px;
				color: #ffffff;
				line-height: 1.8;
				margin-top: 3px;
			}
		}
	}
	.detailsBoxTop {
		padding: 5px 15px;
		box-sizing: border-box;
		border-radius: 3px;
		background-color: #fbfbfb;
		margin-bottom: 20px;
		overflow: hidden;
		box-shadow: 0 3px 5px 1px #e3e3e3;
		.detailsBoxTopTitle {
			display: flex;
			justify-content: space-between;
			align-items: center;
			.detailsBoxTopTitleL {
				padding-left: 10px;
				font-size: $uni-font-size-custom-e;
				color: #878891;
			}
			.detailsBoxTopTitleR {
				padding-right: 10px;
				font-size: $uni-font-size-custom-d;
				color: #424451;
			}
		}
	}
	.detailsBoxZho {
		border-radius: 3px;
		background-color: #fbfbfb;
		overflow: hidden;
		margin-bottom: 20px;
		padding-bottom: 5px;
		box-shadow: 0 3px 5px 1px #e3e3e3;
		.detailsBoxZhoTitle {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 5px 10px;
			background-color: #e4e4e4;
			font-size: $uni-font-size-custom-e;
			color: #424451;
			.detailsBoxZhoTitleL {
				min-width: 150px;
			}
		}
		.detailsBoxZhoText {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 12px;
			.detailsBoxZhoTextL {
				padding-left: 10px;
				font-size: $uni-font-size-custom-e;
				color: #878891;
			}
			.detailsBoxZhoTextR {
				padding-right: 10px;
				font-size: $uni-font-size-custom-d;
				color: #424451;
			}
		}
	}
}
</style>
